package com.lhnstart.learn.bases.innerclass;

/**
 * 内部类练习2
 *
 * @author lhn
 * @date 2023/07/18 17:40
 * @since 1.0.0
 **/
public class InnerClassExercise02 {

    public static void main(String[] args) {
        CellPhone cellPhone = new CellPhone();
        cellPhone.alarmclock(new Bell(){
            @Override
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });
        cellPhone.alarmclock(new Bell(){
            @Override
            public void ring() {
                System.out.println("小伙伴上课了.");
            }
        });

    }

}

interface Bell {
    void ring();
}

class CellPhone {
    public void alarmclock(Bell bell) {
        bell.ring();
    }
}